/*代理模式练习*/

#include <iostream>
#include <string>
//定义代理类接口
class IRentHouse
{
public:
    virtual void rentHouse() = 0;
};
class Landlord : public IRentHouse
{
public:
    virtual void rentHouse() override
    {
        std::cout << "将房子租出去" << std::endl;
    }
};
class Intermediary : public IRentHouse
{
public:
    virtual void rentHouse() override
    {
        std::cout << "发布告示" << std::endl;
        std::cout << "带人看房" << std::endl;
        _landlord.rentHouse();
        std::cout << "装修房子" << std::endl;
    }
private:
    Landlord _landlord;
};

int main()
{
    Intermediary intermediary;
    intermediary.rentHouse();
    return 0;
}